"use client";

import React, { useState, useEffect } from "react";

export default function ClientOnly({ children, fallback }: { children: React.ReactNode; fallback?: React.ReactNode }) {
  const [isClient, setIsClient] = useState(false);

  useEffect(() => setIsClient(true), []);

  return <>{isClient ? <>{children}</> : fallback}</>;
}
